package com.peas.platform.module.icims.base.mdm.adapter.repository.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.peas.platform.common.core.annotation.Comment;
import com.peas.platform.framework.mybatisplus.po.BasePo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import javax.validation.constraints.*;

// 省市区
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`tbl_region`")
public class RegionPo extends BasePo {

    // 省市区类型
    // 1:国家、2:省/直辖市、3:市、4:区县
    // 枚举取值:RegionType
    @Comment(value = "省市区类型", enumType = "RegionType")
    @Size(max = 20, message = "省市区类型不能超过20个字符")
    @TableField(value = "`region_type`", jdbcType = JdbcType.VARCHAR)
    private String regionType;

    // 省市区编码
    @Comment(value = "省市区编码")
    @Size(max = 50, message = "省市区编码不能超过50个字符")
    @TableField(value = "`region_code`", jdbcType = JdbcType.VARCHAR)
    private String regionCode;

    // 省市区名称
    @Comment(value = "省市区名称")
    @Size(max = 100, message = "省市区名称不能超过100个字符")
    @TableField(value = "`region_name`", jdbcType = JdbcType.VARCHAR)
    private String regionName;

    // 状态
    // 枚举取值:CommonEnableDisable
    @Comment(value = "状态", enumType = "CommonEnableDisable")
    @Size(max = 20, message = "状态不能超过20个字符")
    @TableField(value = "`state`", jdbcType = JdbcType.VARCHAR)
    private String state;

    // 上级省市区ID
    // （省市区表）外键
    @Comment(value = "上级省市区ID")
    @TableField(value = "`parent_id`", jdbcType = JdbcType.BIGINT)
    private Long parentId;

}
